package com.yysjyr.logisticssystem.workbench.controller.client;

import com.yysjyr.logisticssystem.common.contants.Contants;
import com.yysjyr.logisticssystem.settings.entity.User;
import jakarta.servlet.http.HttpSession;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
@RequestMapping("/workbench/client/")
public class HomePageController {

    @RequestMapping("homePage")
    public ModelAndView homePage(HttpSession session, Model model) {
        User user = (User) session.getAttribute(Contants.SESSION_USER);
        model.addAttribute("user", user);
        return new ModelAndView("/pages/workbench/client/homepage.html");
    }

}
